package com.mimaxueyuan.disruptor.demo5;

import com.lmax.disruptor.WorkHandler;

/**
 * Callback interface to be implemented for processing units of work as they become available in the RingBuffer.
 * 在RingBuffer中可用的处理单元中实现回调接口。
 * @author: Kevin
 * [每天进步一点点、人生带来大改变...]
 */
public class LongEventWorkeHandler implements WorkHandler<LongEvent> {

	@Override
	public void onEvent(LongEvent event) throws Exception {
		Thread.sleep(1000);
		System.out.println("["+Thread.currentThread().getName()+"]LongEventWorkeHandler consum -> " + event + ",耗时 -> "+(System.currentTimeMillis()-LongEventMain4.startTime));
	}

}
